package com.xique.door.project.sfm.biz.service.impl;

import com.xique.common.core.web.domain.AjaxResult;
import com.xique.door.project.sfm.api.ISfmApi;
import com.xique.door.project.sfm.biz.service.ISfmUserBizService;
import com.xique.door.project.sfm.utils.SfmMD5;
import com.xique.door.project.sfm.utils.SfmUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Service
public class SfmUserBizServiceImpl implements ISfmUserBizService {

    @Autowired
    private ISfmApi sfmApi;

    @Value("${sfm.appid}")
    private String appid;

    @Value("${sfm.appsecret}")
    private String appsecret;

    @Override
    public AjaxResult getHouseUserList(String phone) {

        String timestemp=(new SimpleDateFormat("yyyyMMddHHmmssSSS")).format(new Date()) ;

        Map<String,String> params=new HashMap<String,String>();
        params.put("appid", appid);
        params.put("communityno","");
        params.put("timestemp", timestemp);
        params.put("data", "");
        String sign= SfmMD5.md5(SfmUtils.createLinkString(params)+"&key="+appsecret).toUpperCase();
        params.put("sign", sign);

        return null;
    }
}
